/**
 * Created by sa on 2016/9/22.
 *
 */

  //casperjs hello.js

var casper = require('casper').create();
casper.start('http://casperjs.org/');

casper.then(function() {
  console.log(this.getCurrentUrl());
  this.echo('First Page: ' + this.getTitle());
});

casper.thenOpen('http://phantomjs.org', function() {
  console.log(this.getState());
  this.echo('Second Page: ' + this.getTitle());

});

casper.run(function(){
  console.log("--run--");
  console.log(this.getCurrentUrl());
});
